with Ada.Text_IO;
use Ada.Text_IO;
with Ada.Integer_Text_IO;
use Ada.Integer_Text_IO;

procedure Main is 

	-- GNAT has a limitation where below would have to be in a separate
	-- compilation unit.

	function Addition (A, B: in Integer) return Integer is
	begin
		return A + B;
	end Addition;

	Y, Z : Integer;

	Type Counter is new Integer range 0 .. 5;
	C : Counter;

begin
	Z := Addition(5, 5);
	Put("The result was ");
	Put(Z);
	New_Line;

	-- Call function over a loop.
	C := 0;
	While C < 5 loop
		-- Is what should be done for using Count variables in addition.
		Y := Integer(C);
		Z := Addition(Y, 10);
		Put("The result was ");
		Put(Z);
		New_Line;

		C := C + 1;
	end loop;

	-- Another loop except for loop.
	for I in Integer range 10 .. 15 loop
		-- No use for extra count variable.
		Z := Addition(I, 15);
		Put("The result was ");
		Put(Z);
		New_Line;
	end loop;

end Main;
